Skip to content

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Oct 6, 2025

Summary

Extends DebugMetaPropertiesApplier to read and apply distribution configuration from properties files bundled in the APK. This is part of EME-397 to allow the Sentry Android Gradle Plugin to automatically populate SentryOptions.DistributionOptions fields.

Integration

This allows the Gradle plugin (implemented here) to generate these properties at build time and bundle them into the APK. The SDK will automatically load them when initializing, making distribution configuration seamless for developers.

There are probably many ways of passing these options to the client but using properties files doesn't require the client to recompile resources or code and there is already an existing mechanism in the codebase to do this so I just piggy-backed on that mechanism.

Notes

  • Properties are only applied if the corresponding option is empty/null
  • Supports multiple properties files (uses first one with values)
  • Follows the same pattern as existing properties (bundle IDs, proguard UUID, build tool)

#skip-changelog This feature is not released or published yet.

🤖 Generated with Claude Code

Copy link

linear bot commented Oct 6, 2025

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 380.48 ms 453.16 ms 72.68 ms
Size 1.58 MiB 2.11 MiB 539.35 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d217708 409.83 ms 474.72 ms 64.89 ms
604a261 380.65 ms 451.27 ms 70.62 ms
b3d8889 420.46 ms 453.71 ms 33.26 ms
c8125f3 383.82 ms 441.66 ms 57.84 ms
ee747ae 396.82 ms 441.67 ms 44.86 ms
3d205d0 352.15 ms 432.53 ms 80.38 ms
ce0a49e 532.00 ms 609.96 ms 77.96 ms
17a0955 372.53 ms 446.70 ms 74.17 ms
b3d8889 371.69 ms 432.96 ms 61.26 ms
d217708 411.22 ms 430.86 ms 19.63 ms

App size

Revision Plain With Sentry Diff
d217708 1.58 MiB 2.10 MiB 532.97 KiB
604a261 1.58 MiB 2.10 MiB 533.42 KiB
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
c8125f3 1.58 MiB 2.10 MiB 532.32 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
ce0a49e 1.58 MiB 2.10 MiB 532.94 KiB
17a0955 1.58 MiB 2.10 MiB 533.20 KiB
b3d8889 1.58 MiB 2.10 MiB 535.06 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB

Previous results on branch: no/eme-397-set-sentryoptionsdistributionoptions-from-gradle-or

Startup times

Revision Plain With Sentry Diff
d80d827 373.06 ms 445.63 ms 72.57 ms
ab836f2 341.81 ms 405.30 ms 63.49 ms

App size

Revision Plain With Sentry Diff
d80d827 1.58 MiB 2.11 MiB 539.35 KiB
ab836f2 1.58 MiB 2.11 MiB 539.35 KiB

@runningcode runningcode force-pushed the no/eme-397-set-sentryoptionsdistributionoptions-from-gradle-or branch 2 times, most recently from 37e6a46 to 47bad3a Compare October 6, 2025 14:40
@runningcode runningcode marked this pull request as ready for review October 6, 2025 15:12
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

runningcode and others added 3 commits October 8, 2025 17:04
…roperties

Extends DebugMetaPropertiesApplier to read and apply distribution configuration
from properties files. This allows the Gradle plugin to populate distribution
options (orgSlug, projectSlug, orgAuthToken, buildConfiguration) that will be
automatically loaded when the SDK initializes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Include buildConfiguration in initial property check to fix bug where
  buildConfiguration-only properties would be skipped
- Add isEmpty() checks for all property values before applying
- Add comment explaining break statement (only process first properties file)
- Add test for buildConfiguration-only scenario
- Add test for empty string values

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Rename property from `io.sentry.distribution.org-auth-token` to `io.sentry.distribution.auth-token` to match sentry-android-gradle-plugin
- Rename method from `getDistributionOrgAuthToken` to `getDistributionAuthToken`
- Improve test to verify first properties file with distribution options is used

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/eme-397-set-sentryoptionsdistributionoptions-from-gradle-or branch from 5cb66e4 to f6701a6 Compare October 8, 2025 15:04
@runningcode runningcode enabled auto-merge (squash) October 8, 2025 15:06
@runningcode runningcode disabled auto-merge October 8, 2025 15:24
@runningcode runningcode closed this Oct 8, 2025
@runningcode runningcode reopened this Oct 8, 2025
@runningcode runningcode enabled auto-merge (squash) October 8, 2025 15:25
@runningcode runningcode merged commit 96449e8 into main Oct 8, 2025
60 checks passed
@runningcode runningcode deleted the no/eme-397-set-sentryoptionsdistributionoptions-from-gradle-or branch October 8, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants